import { createRouter, createWebHashHistory } from 'vue-router'
import GLayout from '@/layout/index.vue'
import Login from '@/views/login/login.vue'
import registerGuard from './guard'
import sysRoutes from './modules/sys'
import baseRoutes from './modules/base'
import backRoutes from './modules/back'
import productRoutes from './modules/product'
import hideRouter from './modules/hideRouter'
import marketing from './modules/marketing'
export const asyncRoutes = {
  path: '/',
  component: GLayout,
  children: [
    ...sysRoutes,
    ...baseRoutes,
    ...backRoutes,
    ...productRoutes,
    ...marketing
  ]
}
export const CONSTROUTER = hideRouter
const router = createRouter({
  history: createWebHashHistory(import.meta.env.BASE_URL),
  routes: [
    {
      path: '/login',
      name: 'Login',
      component: Login
    }
  ]
})

registerGuard(router)

export default router
